DataBase Drivers and URL Configurations
Since TomEE doesn't have any UI, all the data sources should be created manually in tomee.xml file in conf directory. Below are the parameters and their corresponding values for different databases.
DB Drivers Config
Oracle
jdbcDriver = oracle.jdbc.driver.OracleDriver
jdbcUrl = jdbc:oracle:thin:@<host>:<port>:<sid>
DB2
jdbcDriver = com.ibm.db2.jcc.DB2Driver
jdbcUrl = jdbc:db2://<host>:<port>/<databasename>:currentSchema=<schemaname>;
For DB2, if the schema name and username are different, please append currentfunctionpath to above url.
Example:
jdbcDriver = com.ibm.db2.jcc.DB2Driver
jdbcUrl = jdbc:db2://<host>:<port>/<databasename>:currentSchema= <schemaname>;currentFunctionPath=SYSIBM,SYSFUN,SYSPROC,SYSIBMADM,SYSHADOOP,USERNAME,SCHEMANAME;
SQLServer
jdbcDriver = com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbcUrl = jdbc:sqlserver://<host>:<port>;DatabaseName=<databasename>
Example:
When the encrypt property is set to true and the trustServerCertificate property is set to true, the Microsoft JDBC Driver for SQL Server won't validate the SQL Server TLS certificate. This setting is common for allowing connections in test environments, such as where the SQL Server instance has only a self-signed certificate.
jdbcUrl = jdbc:sqlserver://<host>:<port>;DatabaseName=<databasename>;encrypt=true;trustServerCertificate=true